﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="description" content="Admin, Dashboard, Bootstrap" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body class="simple-page login-bg">
    <div class="simple-page-wrap">
        <form id="form1" class="form-horizontal">
            <div class="simple-page-form animated flipInY" id="login-form">
                <div class="input-group">
                    <span class="input-group-addon"> <span class="glyphicon glyphicon-user"></span> </span>
                    <input id="Account" type="text" class="form-control" name="Account" required pattern="^[A-Za-z0-9]{4,40}$"
                           title="只能填写5-10位英文或数字" placeholder="用户名或手机号">
                </div>

                <div class="input-group">
                    <span class="input-group-addon"> <span class="glyphicon glyphicon-lock"></span> </span>
                    <input id="PassWord" type="password" class="form-control" name="PassWord" placeholder="密码" required>
                </div>

                <div class="input-group identfy-code">
                    <span class="input-group-addon"> <span class="glyphicon glyphicon-eye-open"></span> </span>
                    <input id="checkCode" name="checkCode" type="text" style="height:53px;" class="form-control bor-r-0" placeholder="验证码" required>
                    <span class="input-group-addon i-code-img"><img id="code" src="/Login/NumberVerifyCode" style="width:80px;height:40px;"></span>
                </div>

                <div class="btn-group btn-g clearfix">
                    <button type="submit" id="login" class="btn btn-warning pull-left">登陆</button>
                    <button type="reset" class="btn btn-danger pull-right">重置</button>
                </div>
            </div><!-- #login-form -->


        </form>
    </div><!-- .simple-page-wrap -->
</body>
</html>
<script src="~/libs/bower/summernote/test/libs/jquery-1.9.1.min.js"></script>
<link rel="stylesheet" href="~/libs/bower/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="~/libs/bower/material-design-iconic-font/dist/css/material-design-iconic-font.min.css">
<link rel="stylesheet" href="~/libs/bower/animate.css/animate.min.css">
<link rel="stylesheet" href="~/assets/css/bootstrap.css">
<link rel="stylesheet" href="~/assets/css/app.css">
<link rel="stylesheet" href="~/assets/css/style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,900,300">
<script src="~/layer/layer.js"></script>

<script type="text/javascript">
    $('#form1').on('submit', function () {
        formPost()
        event.preventDefault() //阻止form表单默认提交
    })
    function formPost() {
        $.ajax({
            type: "post",
            url: "/Login/Login",
            data: $('#form1').serialize(),
        }).success(function (data) {
            if (data.code != 200) {
                layer.msg(data.message, { icon: 2 });
                return;
            }
            window.location.href = '/User/Home/Index'
        }).fail(function (err) {
            layer.msg('系统错误,请稍后重试!', { icon: 2 });
        })
    }

    //点击验证码图片，更换验证码
    $("#code").click(function () {
        $(this).attr("src", "/Login/NumberVerifyCode?time=" + (new Date()).getTime())
    });
</script>